package day14;

import java.util.Arrays;
import java.util.Scanner;

public class demo2 {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n= in.nextInt();
        int []arr=new int[n*3];
        for (int i = 0; i <3*n ; i++) {
            arr[i]=in.nextInt();
        }
        Arrays.sort(arr);
        int sum=0;
        for (int i = n; i <2*n ; i++) {
            sum+=arr[i];
        }
        System.out.println(sum);
    }
}
